package com.cjxy.parking.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cjxy.parking.common.R;
import com.cjxy.parking.entity.po.RechargeDetail;
import com.cjxy.parking.entity.query.RechargeDetailQuery;
import com.cjxy.parking.service.RechargeDetailService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 充值明细 控制器
 *
 * @author: hutao
 * @date: 2025-10-27
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/rechargeDetail")
public class RechargeDetailController {

    private final RechargeDetailService rechargeDetailService;

    /**
     * 分页查询充值明细列表
     *
     * @param rechargeDetailQuery 充值明细查询条件
     * @return 充值明细列表
     */
    @PostMapping("/pageRechargeDetail")
    public R<IPage<RechargeDetail>> pageRechargeDetail(@RequestBody RechargeDetailQuery rechargeDetailQuery) {
        if (rechargeDetailQuery == null) {
            throw new RuntimeException("参数错误");
        }
        return R.success(rechargeDetailService.pageRechargeDetail(rechargeDetailQuery));
    }
}